package com.ruoyi.demowechatpay.enumeration;

import java.util.HashMap;
import java.util.Map;

/**
 * 各个服务的枚举
 *
 * @author wulongcha
 * @date 2021/2/5 1:52 下午
 */
public enum ServiceEnum {

    WECHATPAY("demo-wechatpay", "25"),;

    static final Map<String, ServiceEnum> enumMap = new HashMap<>();

    /**
     * 服务全称
     */
    String fullName;
    /**
     * 服务编码，两位数字
     */
    String code;

    static {
        for (ServiceEnum service : ServiceEnum.values()) {
            enumMap.put(service.fullName, service);
        }
    }

    ServiceEnum(String fullName, String code) {
        this.fullName = fullName;
        this.code = code;
    }

    public static ServiceEnum fullNameOf(String fullName) {
        return enumMap.get(fullName);
    }

    public String getFullName() {
        return fullName;
    }

    public String getCode() {
        return code;
    }
}
